import os
from app import create_app, db
from app.models import *

# 创建应用实例
app = create_app(os.getenv('FLASK_ENV', 'development'))

@app.shell_context_processor
def make_shell_context():
    """为Flask shell添加上下文"""
    return {
        'db': db,
        'User': User,
        'Admin': Admin,
        'Article': Article,
        'Question': Question,
        'Exam': Exam,
        'Certificate': Certificate
    }

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5500, debug=True) 